<include file="Public/min-header"/>
<div class="wrapper">
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-body">
          <div id="ajax_return"> 
			    <div class="table-responsive">
			        <table class="table table-bordered table-hover" id="goos_table">
			            <thead>
			            <tr>
			                <td class="text-left">产品分类</td>            
			                <td class="text-left" id="diss">选择</td>
			                <td class="text-left">操作</td>
			            </tr>
			            </thead>
			            <tbody>
			            <volist name="categorylist" id="list">
                            <tr>
                                <td class="text-left">{$list.name}</td>
                                <td class="text-left" id="dis">
                                    <input type="hidden" name="category_id[{$list.id}]"  value="{$list.id}" class="input-sm" style="display:none;" onkeyup="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')"/>
                                    <input type="checkbox"/>
                                </td>
                                <td><a href="javascript:" onclick="javascript:$(this).parent().parent().remove();">删除</a></td>
                            </tr>
			            </volist>
	                        <tr>
			                    <td class="text-right" colspan="5">
			                        <a href="javascript:void(0)" onclick="select_customer();" class="btn btn-info">确定</a>			                       
								</td>
                           </tr>     
			            </tbody>
			        </table>
			    </div>
          </div>
        </div>
      </div>
    </div>
  </section>
  <script>
  function select_customer()
  {	  
	   if($("input[type='checkbox']:checked").length == 0)
	   {
		   layer.alert('请选择商品分类', {icon: 2}); //alert('请选择商品');
		   return false;
	   }
	  // 将没选中的复选框所在的  tr  remove  然后删除复选框
	    $("input[type='checkbox']").each(function(){
		   if($(this).is(':checked') == false)
		   {
			    $(this).parent().parent().remove();
		   }
		   $(this).siblings().show();
		   $(this).remove();
	    });
		$(".btn-info").remove();
        javascript:window.parent.call_back_goods($('#goos_table').html().replace(/选择/,'用户ID'));
  }    
  </script>
</div>
</body>
</html>